import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/home/Home.vue'

Vue.use(Router)

export default new Router({
  linkExactActiveClass: '',
  routes: [
    {
      path: '/',
      redirect: {
        name: 'home'
      },
      component: Home
    },
    {
      path: '/home',
      name: 'home',
      meta: { requireAuth: true, keepAlive: true },
      component: Home
    },
    {
      path: '/author',
      name: 'Author',
      meta: { keepAlive: true },
      component: () => import(/* webpackChunkName: "Autho" */ './views/author/author.vue') // 404
    },
    {
      path: '/classify',
      name: 'classify',
      meta: { requireAuth: true, keepAlive: false },
      component: () => import(/* webpackChunkName: "classify" */ './views/classify/classify.vue'),
      children: [
        {
          path: 'all/:id',
          name: 'classifyAll',
          meta: { requireAuth: true, keepAlive: false },
          component: () => import(/* webpackChunkName: "classifyAll" */ './views/classify/children/all.vue')
        },
        {
          path: 'sales/:id',
          name: 'classifySales',
          meta: { requireAuth: true, keepAlive: false },
          component: () => import(/* webpackChunkName: "classifyAll" */ './views/classify/children/sales.vue')
        },
        {
          path: 'time/:id',
          name: 'classifyTime',
          meta: { requireAuth: true, keepAlive: false },
          component: () => import(/* webpackChunkName: "classifyAll" */ './views/classify/children/time.vue')
        },
        {
          path: 'price/:id',
          name: 'classifyPrice',
          meta: { requireAuth: true, keepAlive: false },
          component: () => import(/* webpackChunkName: "classifyAll" */ './views/classify/children/price.vue')
        }
      ]
    },
    {
      path: '/me',
      name: 'me',
      meta: { requireAuth: true, keepAlive: true },
      component: () => import(/* webpackChunkName: "me" */ './views/me/me.vue'),
      children: [
        {
          path: 'partner',
          name: 'partner',
          meta: { requireAuth: true, keepAlive: true },
          component: () => import(/* webpackChunkName: "partner" */ './views/me/children/partner/partner.vue'),
          children: [
            {
              path: 'partnerDetail/:id',
              name: 'partnerDetail',
              meta: { requireAuth: true },
              component: () => import(/* webpackChunkName: "share" */ './views/me/children/partner/children/detail.vue')
            },
            {
              path: 'partnerSettle/:id',
              name: 'partnerSettle',
              meta: { requireAuth: true },
              component: () => import(/* webpackChunkName: "share" */ './views/me/children/partner/children/settle.vue')
            }
          ]
        },
        {
          path: 'order',
          name: 'order',
          redirect: 'order/all',
          meta: { requireAuth: true },
          component: () => import(/* webpackChunkName: "order" */ './views/me/children/order/order.vue'),
          children: [
            {
              path: 'all',
              name: 'all',
              meta: { requireAuth: true, keepAlive: false },
              component: () => import(/* webpackChunkName: "all" */ './views/me/children/order/children/all.vue')
            },
            {
              path: 'paid',
              name: 'paid',
              meta: { requireAuth: true, keepAlive: false },
              component: () => import(/* webpackChunkName: "paid" */ './views/me/children/order/children/paid.vue')
            },
            {
              path: 'nonPayment',
              name: 'nonPayment',
              meta: { requireAuth: true, keepAlive: false },
              component: () => import(/* webpackChunkName: "nonPayment" */ './views/me/children/order/children/nonPayment.vue')
            },
            {
              path: 'detail/:id',
              name: 'orderDetail',
              meta: { requireAuth: true, keepAlive: false },
              component: () => import(/* webpackChunkName: "detail" */ './views/me/children/order/children/detail.vue')
            }
          ]
        },
        {
          path: 'ticket',
          name: 'ticket',
          meta: { requireAuth: true, keepAlive: true },
          component: () => import(/* webpackChunkName: "ticket" */ './views/me/children/ticket/ticket.vue'),
          children: [
            {
              path: 'detail',
              name: 'ticketDetail',
              meta: { requireAuth: true, keepAlive: true },
              component: () => import(/* webpackChunkName: "detail" */ './views/me/children/ticket/children/detail.vue')
            }
          ]
        },
        {
          path: 'wallet',
          name: 'wallet',
          meta: { requireAuth: true, keepAlive: true },
          component: () => import(/* webpackChunkName: "wallet" */ './views/me/children/wallet/wallet.vue'),
          children: [
            {
              path: 'card',
              name: 'walletCrad',
              meta: { requireAuth: true },
              component: () => import(/* webpackChunkName: "partner" */ './views/me/children/wallet/children/card.vue')
            },
            {
              path: 'particulars',
              name: 'walletParticulars',
              meta: { requireAuth: true },
              component: () => import(/* webpackChunkName: "partner" */ './views/me/children/wallet/children/particulars.vue')
            },
            {
              path: 'withdraw',
              name: 'walletWithdraw',
              meta: { requireAuth: true },
              component: () => import(/* webpackChunkName: "partner" */ './views/me/children/wallet/children/withdraw.vue')
            }
          ]
        },
        {
          path: 'share',
          name: 'share',
          meta: { requireAuth: true },
          component: () => import(/* webpackChunkName: "share" */ './views/me/children/share/share.vue')
        },
        {
          path: 'about',
          name: 'about',
          meta: { requireAuth: true, keepAlive: true },
          component: () => import(/* webpackChunkName: "about" */ './views/me/children/about/about.vue')
        },
        {
          path: 'collect',
          name: 'collect',
          meta: { requireAuth: true },
          component: () => import(/* webpackChunkName: "collect" */ './views/me/children/collect/collect.vue')
        },
        {
          path: 'feedback',
          name: 'feedback',
          meta: { requireAuth: true },
          component: () => import(/* webpackChunkName: "collect" */ './views/me/children/feedback/feedback.vue')
        },
        {
          path: 'meeting',
          name: 'meeting',
          meta: { requireAuth: true, keepAlive: true },
          component: () => import(/* webpackChunkName: "collect" */ './views/me/children/meeting/meeting.vue'),
          children: [
            {
              path: 'meets',
              name: 'meets',
              meta: { requireAuth: true, keepAlive: true },
              component: () => import(/* webpackChunkName: "share" */ './views/me/children/meeting/children/list.vue')
            },
            {
              path: 'launch',
              name: 'launch',
              meta: { requireAuth: true, keepAlive: true },
              component: () => import(/* webpackChunkName: "share" */ './views/me/children/meeting/children/launch.vue')
            },
            {
              path: 'detail/:id',
              name: 'meetingDetail',
              meta: { requireAuth: true, keepAlive: false },
              component: () => import(/* webpackChunkName: "share" */ './views/me/children/meeting/children/detail.vue')
            }
          ]
        }
      ]
    },
    {
      path: '/shop',
      name: 'shop',
      meta: { requireAuth: true, keepAlive: false },
      component: () => import(/* webpackChunkName: "shop" */ './views/shop/shop.vue'),
      children: [
        {
          path: 'settle',
          name: 'shopSettle',
          meta: { requireAuth: true, keepAlive: false },
          component: () => import(/* webpackChunkName: "collect" */ './views/shop/children/settle.vue')
        }
      ]
    },
    {
      path: '*',
      name: 'NotFound',
      component: () => import(/* webpackChunkName: "NotFound" */ './views/notFound/notFound.vue')
    },
    {
      path: '/detail/:id',
      name: 'detail',
      meta: { requireAuth: true, keepAlive: false },
      component: () => import(/* webpackChunkName: "NotFound" */ './views/detail/detail.vue'),
      children: [
        {
          path: 'settle',
          name: 'detailSettle',
          meta: { requireAuth: true },
          component: () => import(/* webpackChunkName: "NotFound" */ './views/detail/children/settle.vue')
        }
      ]
    },
    {
      path: '/rich',
      name: 'rich',
      meta: { requireAuth: true, keepAlive: false },
      component: () => import(/* webpackChunkName: "NotFound" */ './views/rich/rich.vue')
    },
    {
      path: '/afterSale',
      name: 'afterSale',
      meta: { requireAuth: true },
      component: () => import(/* webpackChunkName: "NotFound" */ './views/after/sale.vue')
    },
    {
      path: '/bindPhone',
      name: 'bindPhone',
      meta: { keepAlive: true },
      component: () => import(/* webpackChunkName: "NotFound" */ './views/bind/phone.vue')
    }
  ]
})
